import re
# 去除\r\n\t字符
s = '\r\nabc\t123\nxyz1234'
print(re.sub('\d{4}', '', s))